//
//  ViewController.m
//  11-XibCustomCell
//
//  Created by 402030900@qq.com on 16/7/28.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import "ViewController.h"
#import "NewsTableViewCell.h"
@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *newsTableView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
// 1.创建cell时,勾选Also create xib file
// 2.在xib文件中,进行cell的布局
// 3.通过自定义cell的xib文件注册cell
    [_newsTableView registerNib:[UINib nibWithNibName:@"NewsTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"cell"];
    // Do any additional setup after loading the view, typically from a nib.
}
#pragma mark --TableView DataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
   NewsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
